import {createRouter,createWebHistory} from 'vue-router'

import Main from '../views/Main.vue'

//创建路由
const router = createRouter({
  history: createWebHistory(),// 使用history模式
  routes: [// 路由规则
    {
      path: "/",//路径
      component: Main,//vue组件
      children: [ // 子路由
        {
          path: "showUser",
          component: () => import("../views/ShowUser.vue"),
        },
        {
          path: "saveUser",
          component: () => import("../views/SaveUser.vue"),
        }
    ]
    },    
  ],
});

export default router